<div class="row">
	<div class="col-md-12">
		<form id="editForm" class="form-horizontal" action="${request.contextPath}/cms/ad/category/update" method="post" onsubmit="return false">
			<input type="hidden" id="id" name="id" value="${cmsAdCategory.id}">
			<div class="box-body">
				<div class="form-group">
					<label id="adCategorySiteIdLabel" for="adCategorySiteId" class="col-sm-2  control-label">所属站点</label>
					<div class="col-sm-10">
						<select class="form-control" id="adCategorySiteId"  name="siteId"  value="${cmsAdCategory.siteId}"  style="width: 100%;" placeholder="选择站点...">
						</select>
					</div>
				</div>
				<div class="form-group">
					<label id="adCategoryNameLabel" for="adCategoryName" class="col-sm-2 control-label">名称</label>
					<div class="col-sm-4">
						<input type="text" class="form-control" name="name" id="adCategoryName" value="${cmsAdCategory.name}" placeholder="输入名称...">
					</div>
					<label id="adCategoryCodeLabel" for="adCategoryCode" class="col-sm-2 control-label">编码</label>
					<div class="col-sm-4">
						<input type="text" class="form-control" name="code" id="adCategoryCode" value="${cmsAdCategory.code}" placeholder="输入编码...">
					</div>
				</div>
				<div class="form-group">
					<label id="adCategoryDescriptionLabel" class="col-sm-2 control-label" >描述</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="description" id="adCategoryDescription" value="${cmsAdCategory.description}" placeholder="输入描述...">
					</div>
				</div>
				<div class="form-group">
					<label id="adCategorySortOrderLabel" for="adCategorySortOrder" class="col-sm-2  control-label">排序</label>
					<div class="col-sm-2">
						<input  class="form-control" name="sortOrder" id="adCategorySortOrder" type="number"  value="${cmsAdCategory.sortOrder}" placeholder="请输入...">
					</div>
					<label id="adCategoryStatusLabel" for="adCategoryStatus" class="col-sm-2  control-label">状态</label>
					<div class="col-sm-2">
						<select class="form-control" id="adCategoryStatus"  name="status" value="${cmsAdCategory.status}"  style="width: 100%;">
						</select>
					</div>
				</div>
				<div class="form-group">
					<label id="adCategoryRemarkLabel" class="col-sm-2 control-label">备注</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="remark" id="adCategoryRemark" value="${cmsAdCategory.remark}" placeholder="输入备注...">
					</div>
				</div>
				<div class="error-message text-center" >
					<span class="error-icon"></span>
					<span id="error-msg" class="error-msg" ></span>
				</div>
			</div>
			<div class="box-footer">
				<div class="pull-right">
					<button type="button" class="btn btn-default btn-sm" data-dismiss="modal"><i class="fa fa-close"></i> 关闭</button>
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">

    $(function() {
        $("#adCategoryStatus").select2({
            data: StatusStore,
            theme: "bootstrap",
            minimumResultsForSearch: Infinity
        }).val('${cmsAdCategory.status}').trigger("change");

		$.ajax({
			type:"get",
			url:'/cms/site/list',
			dataType:'json'
		}).done(function(result){
			var o = [];
			var a = result;
			$.each(a, function() {
				if(this.id !== undefined && this.id !==''){
					o.push({'id':this.id,'text':this.name});
				}
			});
			$("#adCategorySiteId").select2({
				data:o,
				placeholder: "站点...",
				allowClear: true,
				language: "zh-CN",
				theme: "bootstrap"
			}).val('${cmsAdCategory.siteId}').trigger("change");
		});

    });
</script>